import request from '@/utils/request-app'

const prefixUrl = 'app/worker/'

// 获取工单
export function getWorkOrderList(data) {
	return request({
	  url: prefixUrl + 'getWorkOrderListByApp',
	  method: 'post',
	  data: data,
	  content_type: 'json'
	})
}
// 根据工单Id和工单类型和是否提交获取对应信息
export function getOrderDetail(params) {
  return request({
    url: prefixUrl + 'getOrderDetailByApp',
    method: 'get',
    params
  })
}

// 根据工单ID和TYPE获取楼盘列表
export function getOrderBuilding(params) {
  return request({
    url: prefixUrl + 'getOrderBuilding',
    method: 'get',
    params
  })
}

// 查看楼盘列表
export function getBuildingList(params) {
  return request({
    url: prefixUrl + 'getBuildingList',
    method: 'get',
    params
  })
}

// 根据楼盘id查看设备列表
export function getBuildingDeviceList(params) {
  return request({
    url: prefixUrl + 'getBuildingDeviceList',
    method: 'get',
    params
  })
}

// 根据设备id查看工单列表
export function getOrderByDevice(params) {
  return request({
    url: prefixUrl + 'getOrderByDevice',
    method: 'get',
    params
  })
}

// 根据工单id查看合同列表
export function getContentByOrder(params) {
  return request({
    url: prefixUrl + 'getContentByOrder',
    method: 'get',
    params
  })
}

// 根据合同id查看时间列表
export function getSettingByContent(params) {
  return request({
    url: prefixUrl + 'getSettingByContent',
    method: 'get',
    params
  })
}

// 根据工单id、合同id、时间id查看设备列表
export function getDeviceByDateRangeAndBuildingLocations(params) {
  return request({
    url: prefixUrl + 'getDeviceByDateRangeAndBuildingLocations',
    method: 'get',
    params
  })
}

// 替换工单点位
export function replaceWorkOrderPoint(data) {
  return request({
    url: prefixUrl + 'replaceWorkOrderPoint',
    method: 'post',
    data,
    content_type: 'json'
  })
}

// 根据提交记录id，查询信息
export function getAuditInfo(params) {
  return request({
    url: prefixUrl + 'getAuditInfo',
    method: 'get',
    params
  })
}
